<?php
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'common.php';
use lapsha\common as _;

class checkCallableTest extends PHPUnit_Framework_TestCase {
	
	public function testSuccess() {
		try {
			_\checkCallable('fopen');
			_\checkCallable('PHPUnit_Framework_TestCase::fail');
			_\checkCallable(create_function('', ''));
			_\checkCallable(function() {});
		} catch (InvalidArgumentException $exception) {
			$this->fail('Should be callable', $exception);
		}
	}
	public function testFailure() {
		try {
			_\checkCallable(1);
			_\checkCallable('tatarata');
		} catch (InvalidArgumentException $exception) {
			return;
		}
		$this->fail('Should not be callable');
	}
	
}